Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add upgrade E2E #1003

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

m1kola
Copy link
Member

@m1kola m1kola commented Jul 2, 2024

Description

Testing upgrade from the latest release to the current commit.

Fixes #856

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 2, 2024
Copy link

netlify bot commented Jul 2, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 2cf7d2e
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/668fa113c9ce1000084be3f6
😎 Deploy Preview https://deploy-preview-1003--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.60%. Comparing base (db5a75c) to head (2cf7d2e).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1003   +/-   ##
=======================================
  Coverage   77.60%   77.60%           
=======================================
  Files          18       18           
  Lines        1268     1268           
=======================================
  Hits          984      984           
  Misses        202      202           
  Partials       82       82           
Flag Coverage Δ
e2e 56.44% <ø> (ø)
unit 52.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@m1kola m1kola force-pushed the upgrade-e2e-skeleton branch 4 times, most recently from 90c602f to 0cc4c2e Compare July 3, 2024 15:08
@tmshort
Copy link
Contributor

tmshort commented Jul 3, 2024

My general question is... do we want to use bash scripts for this, or do we want to use golang?

./hack/pre-upgrade-setup.sh $(CATALOG_IMG) $(TEST_CLUSTER_CATALOG_NAME) $(TEST_CLUSTER_EXTENSION_NAME)

.PHONY: post-upgrade-checks
post-upgrade-checks:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also run the standard e2e after an upgrade as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were considering this, but decided not to because:

  1. It will be an equivalent of running E2E on the current commit and we are doing it anyway in a separate E2E job.
  2. It will increase feedback time and has potential to add noise to the signal (e.g. upgrade was successful, but post-upgrade E2E test flaked) - you have to re-test and wait again.

@joelanford
Copy link
Member

Do we want to use bash scripts for this, or do we want to use golang?

This is a good question. I don't necessarily think its an either-or thing. I could see something like:

sh <installPreviousRelease>
sh <setupPreUpgradeState>
sh <upgradeIt>
go test ./test/upgrade-e2e/...

@joelanford
Copy link
Member

Another interesting upgrade question: At what point do we need to actually define an upgrade process? An upgrade is generally:

  1. Create objects that are net new in the new release
  2. Update objects that are changed from the old release to the new release
  3. Delete objects that were present in the old release, but not the new release

We don't do step 3 right now, right? Is doing step 3 a prereq for valid upgrade testing?

@m1kola
Copy link
Member Author

m1kola commented Jul 4, 2024

Another interesting upgrade question: At what point do we need to actually define an upgrade process? An upgrade is generally:

  1. Create objects that are net new in the new release
  2. Update objects that are changed from the old release to the new release
  3. Delete objects that were present in the old release, but not the new release

We don't do step 3 right now, right? Is doing step 3 a prereq for valid upgrade testing?

We were talking about this with @ankitathomas. It sounds a bit like we are testing something that doesn't exist at this moment (the upgrade process).

We decided not to open a can of worms for now and assume that the upgrade process is just:

  • For operator-controller - run the install script on top of what already exists
  • For catalogd - apply manifests on top of what already exists

This should be enough short-term: it should signal when someone adds something breaking to manifests/install script.

But long term we probably want to define upgrade process and probably create tool for that. E.g. we will likely need to some migration tool where it is possible to clean up old in-cluster objects from previous releases. We can use OpenShift's Cluster Version Operator and how it handles deletions.

But IMO - this deserves its own epic. What do you think? Should we put this on hold and define upgrade process & create necessary tools first? Or should we proceed with this naive approach of just applying things on top?

Do we want to use bash scripts for this, or do we want to use golang?

This is a good question. I don't necessarily think its an either-or thing. I could see something like:

sh <installPreviousRelease>
sh <setupPreUpgradeState>
sh <upgradeIt>
go test ./test/upgrade-e2e/...

I decided to keep bash in the draft for now. We can switch to Go when/if we decide to do something more sophisticated here.

@m1kola m1kola force-pushed the upgrade-e2e-skeleton branch 2 times, most recently from 511a8d6 to 51e0c3a Compare July 5, 2024 12:43
@joelanford
Copy link
Member

joelanford commented Jul 5, 2024

Already have an epic for proper upgrade support. #982

I agree that this epic should not be blocked on that one.

I think naive approach is good enough for now, but I suspect there could be some cases where leaving around old manifests causes the upgrade tests to pass when cleaning them up would have made them fail. As an example: a PR that deletes our issuer Certificate from our manifest with no other changes.

@m1kola
Copy link
Member Author

m1kola commented Jul 8, 2024

I suspect there could be some cases where leaving around old manifests causes the upgrade tests to pass when cleaning them up would have made them fail. As an example: a PR that deletes our issuer Certificate from our manifest with no other changes.

Yes, there will be cases like that, but in this specific example, I think, we will catch the issue in the E2E job because a clean setup will fail.

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything else you're thinking of doing before taking this out of draft? At a quick glance, I think this is looking really good!

Testing upgrade from the latest release to the current commit

Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
@m1kola
Copy link
Member Author

m1kola commented Jul 11, 2024

Anything else you're thinking of doing before taking this out of draft? At a quick glance, I think this is looking really good!

@joelanford I just wanted to take another fresh look in the morning and clean some things up. Nothing major: adjusting test logs for consistency, a bit of comment changes and moving variables around. Here is the diff between the version you looked at and the latest state.

Should be good now. Marking as ready for review.

@m1kola m1kola marked this pull request as ready for review July 11, 2024 09:16
@m1kola m1kola requested a review from a team as a code owner July 11, 2024 09:16
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 11, 2024
Copy link
Contributor

@tmshort tmshort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
Just one question on the location of a file... it doesn't necessarily stop this from being merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to put this under the test/tools directory? There are a few other testing scripts there, we might want to consolidate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be done later (if we desire)

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 12, 2024
@tmshort tmshort added this pull request to the merge queue Jul 12, 2024
Merged via the queue into operator-framework:main with commit 1d1c322 Jul 12, 2024
17 checks passed
@m1kola m1kola deleted the upgrade-e2e-skeleton branch July 15, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[epic] Implement upgrade tests for OperatorController
3 participants